import store from '@/store';

export default {
	methods: {
		onJump(url,type='navigateTo'){
			if(type=='tabbar'){
				uni.switchTab({
					url:url
				})
			}else if(type=='redirectTo'){
				uni.redirectTo({
					url:url
				})
			}else if(type=='reLaunch'){
				uni.reLaunch({
					url:url
				})
			}else{
				uni.navigateTo({
				    url:url
				})
			}
		},
		// 跳转前判断登录
		onTokenJump(url,type='navigateTo') {
			this.judgeLogin(() => {
				if(type=='tabbar'){
					uni.switchTab({
						url:url
					})
				}else if(type=='redirectTo'){
					uni.redirectTo({
						url:url
					})
				}else if(type=='reLaunch'){
					uni.reLaunch({
						url:url
					})
				}else{
					uni.navigateTo({
					    url:url
					})
				}
			});
		},
	},
	onShareAppMessage(res) {
		return {
			title: '',
			// #ifdef MP-TOUTIAO
			desc: '',
			// #endif
			imageUrl: '',
			path: '/pages/index/index'
		}
	},
	onShareTimeline(res) {
		return {
			title: '',
			imageUrl: '',
			path: '/pages/index/index'
		}
	}
}